﻿#pragma once
#include <memory>

#ifdef DM_PLATFORM_WINDOWS
	#ifdef DM_DYNAMIC_BUILD
		#ifdef DM_BUILD_DLL
			#define DM_API __declspec(dllexport)
		#else
			#define DM_API __declspec(dllimport)
		#endif // DM_BUILD_DLL
	#else
		#define DM_API 
	#endif // DM_DYNAMIC_BUILD
#else 
	#error DM only supports windows!
#endif



#define BIT(x) (1 << x)
#define DM_BIND_EVENT_FN(fn) [this](auto&&... args) -> decltype(auto) { return this->fn(std::forward<decltype(args)>(args)...); }

namespace DM {

	template<typename T>
	using Scope = std::unique_ptr<T>;
	template<typename T, typename ... Args>
	constexpr Scope<T> CreateScope(Args&& ... args)
	{
		return std::make_unique<T>(std::forward<Args>(args)...);
	}

	template<typename T>
	using Ref = std::shared_ptr<T>;
	template<typename T, typename ... Args>
	constexpr Ref<T> CreateRef(Args&& ... args)
	{
		return std::make_shared<T>(std::forward<Args>(args)...);
	}

}

#include "DM/Core/Log.h"
#include "DM/Core/Assert.h"